#include "HighScore.h"
using namespace frost;

HighScore::HighScore(void)
{
	name = "";
	points = 0;
}


HighScore::~HighScore(void)
{
}

string HighScore::Write()
{
	ostringstream oss;
	oss << setw(10) << left << name << setw(10) << right << points << endl;
	return oss.str();
}

bool HighScore::operator<(HighScore &hsl)
{
	return this->points > hsl.GetPoints();
}

// Format name,points
//ostream& operator<<(ostream &out, frost::HighScore &hs)
//{
//	out << hs.name << "," << hs.points << endl;
//	return out;
//}


	istream &frost::operator>>(istream &in, HighScore &hs)
	{
		string s;
		int points;
		getline(in,s,',');
		hs.SetName(s);
		in >> points;
		hs.SetPoints(points);
		getline(in,s);
		return in;
	}

